<?php
namespace app\shop\model;

use cubox\Model;

class Goods extends Model{
    public function defineStatus(){
        return [
            'sale' => '在售',
            'off' => '未在售',
            'delete' => '删除'
        ];
    }

    public function getStatusTitle($type){
        return $this->defineStatus()[$type]??'';
    }

    public function formate($data){
        $data['status_title'] = $this->getStatusTitle($data['status']);
        return $data;
    }
}